import java.util.*;
public class Main {
    /**
     * 序列（2023年国赛）
     * @param args
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        long[] a=new long[n];
        long count=0;
        for(int i=0;i<n;i++){
            a[i]=in.nextLong();
        }
        for(int i=0;i<n;i++){
            long last=(long)(i+1)*n;
            long ret=func((long)(i+1),a[i]);
            count+=last/ret;
        }
        System.out.println(count);
        in.close();
    }
    public static long func(long a,long b){
        return a*b/gac(a,b);
    }
    public static long gac(long a,long b){
        while(b!=0){
            long tmp=b;
            b=a%b;
            a=tmp;
        }
        return a;
    }
    /**
     * 玩具(2023年国赛)
     * @param args
     */
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        long[] w=new long[2*n];
        for(int i=0;i<2*n;i++){
            w[i]=in.nextLong();
        }
        Arrays.sort(w);
        int left=0,right=2*n-1;
        long res=0;
        while(left<right){
            res+=w[left]*w[right];
            left++;
            right--;
        }
        System.out.println(res);
        in.close();
    }
}